export default function AddCondition(temp, values, key) {
    function handlerQueryRefer(temp, key, values) {
        let items = temp.items;
        items.map(val => {
            if (val.itemtype !== 'refer') return;
            if (key) {
                if(val.attrcode === key){
                    val.queryCondition = function () {
                        return values
                    }
                }
            } else {
                val.queryCondition = function () {
                    return values
                }
            }


        });

        return temp
    }

    return handlerQueryRefer(temp, key, values)
}
